package com.game.majiang.vo;

import java.util.ArrayList;

import javax.sql.rowset.CachedRowSet;

import com.game.server.db.SqlHelper;

import lombok.Data;

@Data
public class RollMessageDataVo {

	public int id;
	public int type;
	public String content;
	public int unionid;
	public int startusing;
	
	public static ArrayList<RollMessageDataVo> getListRollMessageData() {
		
		String sql = "SELECT id,type,content,unionid,startusing FROM rollmessagedata";
		CachedRowSet resultSet = SqlHelper.getResultSet(sql);
		ArrayList<RollMessageDataVo> list = new ArrayList<RollMessageDataVo>();
		try {
			while (resultSet.next()) {
				RollMessageDataVo rdv = new RollMessageDataVo();
				rdv.setId(resultSet.getInt("id"));
				rdv.setType(resultSet.getInt("type"));
				rdv.setContent(resultSet.getString("content"));
				rdv.setUnionid(resultSet.getInt("unionid"));
				rdv.setStartusing(resultSet.getInt("startusing"));
				list.add(rdv);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
		
	}
	
}
